package com.alex.springboot.mapper;

import com.alex.springboot.entity.Privilege;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface PrivilegeMapper {

    @Insert("insert into t_privilege(name) values(#{name})")
    int save(Privilege privilege);

    @Delete("delete from t_privilege where id=#{id}")
    int delete(@Param("id") Integer id);

    @Update("update t_privilege set name=#{name} where id=#{id}")
    int update(Privilege privilege);

    @Select("select id,name from t_privilege where id=#{id}")
    Privilege getById(@Param("id") Integer id);

    @Select("select id,name from t_privilege")
    List<Privilege> selectAll();

}
